package mx.itschapala.dsw2.vista;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean
@SessionScoped
public class AccessBean {

    //Variables (propiedades)
    private String name;
    private String password;    
   
    // Constructores
    
    public AccessBean() {
    }

    public String getName() {
        System.out.println("Entro al GET");
        return name;
    }

    public void setName(String name) {
        System.out.println("Entro al SET");
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    
    //Acciones

    public String validarLogin(){
        if(name.equals("root")&&password.equals("12345")){
            return "MenuPrincipal";
        }else{
            return "Pagina2";
        }
    }
    
    //Listeners
    
    
}
